Skip to content

Conversation

@josh-wong
Copy link
Member

Description

This PR enhances the glossary tooltip component by improving its handling of glossary terms and their plural forms, while also refining the conditions under which tooltips are applied. The changes also include not showing tooltips for terms in backticks, which might be distracting and unnecessary in many cases.

Related issues and/or PRs

N/A

Changes made

Improvements to glossary term matching

  • Updated the regex pattern to match both exact terms and their plural forms (s or es), while also making the matching case-insensitive. This ensures broader and more accurate term detection. (src/components/GlossaryInjector.tsx, src/components/GlossaryInjector.tsxL69-R148)
  • Adjusted the tooltip rendering logic to ensure that terms are underlined when a plural form is detected. (src/components/GlossaryInjector.tsx, src/components/GlossaryInjector.tsxL69-R148)

Refinements to tooltip exclusions

  • Added a check to skip inline code blocks (text wrapped in backticks) when wrapping terms in tooltips, preventing unnecessary interference with code formatting. (src/components/GlossaryInjector.tsx, [1] [2]

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have updated the side navigation as necessary.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

@josh-wong josh-wong self-assigned this May 22, 2025
@josh-wong josh-wong added the enhancement New feature or request label May 22, 2025
@josh-wong josh-wong merged commit 6058674 into main May 22, 2025
1 check passed
@josh-wong josh-wong deleted the refine-glossary-tooltip-feature branch May 22, 2025 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant